<extend name="Public/base"/>
<block name="body">
    <div class="main-title">
        <h2>云市场扩展自动升级</h2>
    </div>
    <div class="with-padding" id="version_list" style="width: 800px">
        <h3 style="padding-top: 0;margin-top: 0">
            即将升级的扩展
        </h3>
        <ul class="module-list">
            <volist name="modules" id="vo">
                <li class="clearfix" style="margin-bottom: 0">
                    <div class="cover-wrapper">
                        <empty name="vo.version_info.goods.cover_url">
                            <div class="cover-icon">
                                <i class="icon-{$vo.icon}"></i>
                            </div>
                            <else/>
                            <img class="cover"
                                 src="__CLOUD__/{$vo.version_info.goods.cover_url}"/>
                        </empty>


                    </div>
                    <div class="content-wrapper">
                        <div class="title">
                            <a href="{:U('Admin/Module/edit', array('name' => $vo['name']))}">{$vo.alias} <span class="text-muted">{$vo.name}</span></a>

                            <div class="pull-right"><span class="label label-info">{$vo.version_info.title}</span>
                                <empty name="vo.update_list">
                                    <else/>
                                    <a style="text-decoration: none"
                                            ><span class=" label label-success ">最新版{$vo.update_list.0.title}</span></a>
                                </empty>
                            </div>
                        </div>
                        <div>
                            <p class="text-muted text-ellipsis">{$vo.summary}</p>
                        </div>
                        <div>开发者： <a style="color: #666">{$vo.developer}</a></div>
                        <div class="clearfix bottom-btns">
                            <div class="pull-left">
                                <a class="btn btn-default"
                                   href="{:U('Module/edit', array('name' => $vo['name']))}">编辑</a>
                            </div>
                            <div class="pull-right">
                                <empty name="vo.token">
                                    <span class="label label-circle label-danger">本地模块</span>
                                    <else/>
                                    <a target="_blank"
                                       href="{:appstoreU('Appstore/Index/goodsDetail',array('token'=>$vo['token']))}"
                                       class="btn btn-info">去云市场查看</a>
                                </empty>
                            </div>
                        </div>
                    </div>
                </li>
            </volist>
        </ul>
        <empty name="versionList">



            <div class="alert alert-success">
                已经是最新版本了哟。
            </div>

            <else/>
            <div class="alert alert-info">
            <p>当前需要升级的版本：<strong>{$versionList.0.title}</strong></p>

            <p>当前的版本号：<strong>{$version.title}</strong></p>
        </div>
            <h3>可以升级的版本</h3>
            <table class="table table-bordered table-striped table-hover ">
                <thead>
                <tr>
                    <th style="width: 80px">版本号</th>
                    <th style="width: 150px">发布时间</th>
                    <th>更新日志</th>
                </tr>
                </thead>
                <volist name="versionList" id="vo">
                    <tr>
                        <td>{$vo.title}</td>
                        <td>{$vo.create_time|friendlyDate}</td>
                        <td>
                            {$vo.log|formatLog}
                        </td>
                    </tr>
                </volist>
            </table>
            <a href="{:U('Updating1',array('token'=>$token))}" class="btn btn-success btn-block btn-lg">开始升级</a>
        </empty>





    </div>


    <script>
        function writeMessage($data) {
            $('#message').append($data);
        }
        function replaceMessage($data) {
            $('#message').children().last().remove();
            $('#message').children().last().remove();
            $('#message').append($data);
        }
        var progress = {
            'show': function () {
                $('#progress').parent().show();
            },
            'setValue': function ($value) {
                $('#progress').css('width', $value);
            },
            'hide': function () {
                $('#progress').parent().hide();
            }
        }
    </script>
</block>